package com.example.administrator.androidui3;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    class  MYOnClickListener implements View.OnClickListener{

        @Override
        public void onClick(View v) {
            Toast.makeText(MainActivity.this, "登录失败", Toast.LENGTH_SHORT).show();

        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.aaa_layout);
        Button btnLogin = findViewById(R.id.btn_login);
        MYOnClickListener listener=new MYOnClickListener();
        btnLogin.setOnClickListener(listener);
    }

    public void click(View view) {
        Toast.makeText(this, "你好！", Toast.LENGTH_SHORT).show();
    }
}
